<!--菜单添加-->
<div class="dialog_content">
	<form id="info_form" name="info_form" action="{:U('menu/add')}" method="post">
    <table width="100%" class="table_form">
    	<tr>
          <th width="100">上级菜单 :</th>
          <td>
          	<select name="pid">
            	<option value="0">作为一级菜单</option>
            	{$select_menus}
            </select>
          </td>
        </tr>
        <tr>
          <th>菜单名称 :</th>
          <td><input type="text" name="name" id="name" class="input-text"></td>
        </tr>
        <tr>
            <th>图标 :</th>
            <td><input type="text" name="icon" id="icon" class="input-text"></td>
        </tr>
        <tr>
          <th>模块名 :</th>
          <td><input type="text" name="module_name" id="module_name" class="input-text"></td>
        </tr>
        <tr>
          <th>方法名 :</th>
          <td><input type="text" name="action_name" id="action_name" class="input-text"></td>
        </tr>
        <tr> 
          <th>附加参数 :</th>
          <td><input type="text" name="data" id="data" class="input-text"></td>
        </tr>
        <tr>
          <th>备注 :</th>
          <td><textarea name="remark" id="remark" cols="40" rows="3"></textarea></td>
        </tr>
        <tr>
          <th>是否显示菜单 :</th>
          <td>
            <label><input type="radio" name="display" class="radio_style" value="1" checked="checked"> 是&nbsp;&nbsp;</label>
            <label><input type="radio" name="display" class="radio_style" value="0"> 否</label>
          </td>
        </tr>
    </table>
    </form>
</div>
<script>
$(function(){
    
	$.formValidator.initConfig({formid:"info_form",autotip:true});
	$("#name").formValidator({ onshow:lang.please_input+lang.menu_name, onfocus:lang.please_input+lang.menu_name, oncorrect:lang.input_right}).inputValidator({ min:1, onerror:lang.please_input+lang.menu_name});
	$("#module_name").formValidator({ onshow:lang.please_input+lang.module_name, onfocus:lang.please_input+lang.module_name, oncorrect:lang.input_right}).inputValidator({ min:1, onerror:lang.please_input+lang.module_name});
	$("#action_name").formValidator({ onshow:lang.please_input+lang.action_name, onfocus:lang.please_input+lang.action_name, oncorrect:lang.input_right}).inputValidator({ min:1, onerror:lang.please_input+lang.action_name});
	
	$('#info_form').ajaxForm({success:complate,dataType:'json'});
	function complate(result){
		if(result.errNum === 0){
			$.dialog.get('add').close();
			$.yhxia.tip({content:result.retData});
			window.location.reload();
		} else {
			$.yhxia.tip({content:result.errMsg, icon:'alert'});
		}
	}
})
</script>